package com.exchange.View;

import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.view.ViewGroup;
import android.view.WindowManager.LayoutParams;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.TextView;
import com.exchange.Controller.a;
import com.exchange.Public.f;
import com.exchange.Public.h;
import com.exchange.Public.m;
import com.exchange.View.a.a;
import com.exchange.View.a.b;
import com.exchange.b.a;
import java.util.ArrayList;
import java.util.List;

public class PearlCurtainDialog extends Dialog
{
  boolean a;
  U b;
  ListView c;
  private int d;
  private Context e;
  private List<a> f;
  public int mItemCount;
  public int mType;
  public ViewGroup view;

  private void a()
  {
    int i;
    a locala;
    ArrayList localArrayList;
    int k;
    int i2;
    boolean bool;
    this.c = ((ListView)this.view.findViewById(b.x(this.e)));
    this.c.setCacheColorHint(Color.argb(0, 255, 255, 255));
    RelativeLayout.LayoutParams localLayoutParams = (RelativeLayout.LayoutParams)this.c.getLayoutParams();
    if (h.d(this.e))
    {
      i = 130;
      localLayoutParams.height = h.a(i, this.e);
      this.c.setLayoutParams(localLayoutParams);
      locala = (a)this.f.get(this.d);
      ImageView localImageView = (ImageView)this.view.findViewById(b.r(this.e));
      new f(this.e, localImageView, locala.e).start();
      ((TextView)this.view.findViewById(b.l(this.e))).setText(locala.g);
      ((TextView)this.view.findViewById(b.n(this.e))).setText(m.a(this.e, locala.n));
      ((TextView)this.view.findViewById(b.q(this.e))).setText(locala.a);
      ((TextView)this.view.findViewById(b.t(this.e))).setText("开发：" + locala.u);
      ((TextView)this.view.findViewById(b.u(this.e))).setText("名称：" + locala.g);
      ((TextView)this.view.findViewById(b.w(this.e))).setText(locala.b);
      localArrayList = new ArrayList();
      localArrayList.add(new a());
      int j = this.mItemCount - 1;
      k = 1 + this.d;
      int l = j + this.d;
      if (l > this.f.size() - 1)
        l = this.f.size() - 1;
      int i1 = j - 1 + l - k - 1;
      if (k <= l)
        break label623;
      i2 = 0;
      if (i2 <= i1)
        break label654;
      new a(this.e, 0, this.f.subList(0, this.mItemCount), this.mType, 2, 0).start();
      if (localArrayList.size() != 1)
        break label685;
      localArrayList.remove(0);
      bool = false;
    }
    while (true)
    {
      while (true)
      {
        while (true)
        {
          while (true)
          {
            new ah(this.c, this.e, a.j(this.e), bool, localArrayList, this.mType).a(new K(this));
            ((Button)this.view.findViewById(b.e(this.e))).setOnClickListener(new L(this));
            ((Button)this.view.findViewById(b.f(this.e))).setOnClickListener(new M(this));
            ((Button)this.view.findViewById(b.h(this.e))).setOnClickListener(new R(this, locala));
            return;
            i = 80;
          }
          label623: localArrayList.add((a)this.f.get(k));
          k += 1;
        }
        label654: localArrayList.add((a)this.f.get(i2));
        i2 += 1;
      }
      label685: bool = true;
    }
  }

  void a(a parama)
  {
    int i = 0;
    while (true)
    {
      int j;
      if (i >= this.f.size())
        j = 0;
      while (true)
      {
        this.d = j;
        a();
        return;
        if (!(parama.g.equals(((a)this.f.get(i)).g)))
          break;
        j = i;
      }
      ++i;
    }
  }
}